/*
 * Copyright 2007 Matt Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.jtell.internal.config.xml;

import java.util.List;
import java.util.ArrayList;

/**
 * <p>
 * <code>JTellElement</code> accumulates and holds the information in a <code>&lt;jtell ...&gt;</code> configuration
 * element.
 * </p>
 * <p>
 * <strong>Thread Safety</strong><br/>
 * Instances of this class are not safe for multithreaded access. 
 * </p>
 */
public class JTellElement
{
    /**
     * <p>
     * Nested <code>&lt;listener ...&gt;</code> elements. 
     * </p>
     */
    private final List<ListenerElement> m_listeners = new ArrayList<ListenerElement>();

    /**
     * <p>
     * Construct a {@link JTellElement} instance.
     * </p>
     */
    public JTellElement()
    {
        super();
    }

    /**
     * <p>
     * Add a nested <code>&lt;listener ...&gt;</code> element.
     * </p>
     * 
     * @param listener the element.
     */
    public JTellElement addListener(final ListenerElement listener)
    {
        m_listeners.add(listener);
        return this;
    }

    public List<ListenerElement> getListeners()
    {
        return m_listeners;
    }
}
